<!DOCTYPE html>
<html 
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"
	lang="en">
<head>
	<th:block th:include="layout/header :: header-meta('Configuration')"></th:block>
</head>
<body>

<th:block th:include="layout/header :: navbar"></th:block>

<div class="container">

<div th:if="${param.success ne null and param.success[0] eq 'true'}" class="alert alert-success">Saved!</div>

<!-- icon -->
<form method="post" enctype="multipart/form-data" action="/admin/configuration/upload-icon">
	<span class="btn btn-default btn-file">
		Select icon (50 x 50 px) <input type="file" name="icon" />
	</span>
	<input type="submit" value="Upload" class="btn btn-primary" />
</form>
<br />
<img src="/spring/icon" alt="logo" style="float:left;padding-right:10px" />
<!-- /icon -->

<div style="clear:both"></div>

<br />

<!-- favicon -->
<form method="post" enctype="multipart/form-data" action="/admin/configuration/upload-favicon">
	<span class="btn btn-default btn-file">
		Select icon (32 x 32 px) <input type="file" name="favicon" />
	</span>
	<input type="submit" value="Upload" class="btn btn-primary" />
</form>
<br />
<img src="/spring/icon/favicon" alt="favicon" style="float:left;padding-right:10px" />
<!-- /favicon -->

<div style="clear:both"></div>

<br />

<!-- appleTouchIcon -->
<form method="post" enctype="multipart/form-data" action="/admin/configuration/upload-appleTouchIcon">
	<span class="btn btn-default btn-file">
		Select icon (180 x 180 px) <input type="file" name="appleTouchIcon" />
	</span>
	<input type="submit" value="Upload" class="btn btn-primary" />
</form>
<br />
<img src="/spring/icon/appleTouchIcon" alt="appleTouchIcon" style="float:left;padding-right:10px" />
<!-- /appleTouchIcon -->

<div style="clear:both"></div>

<br /><br />

<form action="" method="post" th:object="${configuration}" class="form-horizontal" autocomplete="off">

		<div class="form-group">
			<label for="brandName" class="col-sm-2 control-label">Brand name:</label>
			<div class="col-sm-10">
				<input type="text" th:field="*{brandName}" class="form-control" />
			</div>
		</div>

		<div class="form-group">
			<label for="title" class="col-sm-2 control-label">Title:</label>
			<div class="col-sm-10">
				<input type="text" th:field="*{title}" class="form-control" />
			</div>
		</div>

		<div class="form-group">
			<label for="title" class="col-sm-2 control-label">Homepage heading:</label>
			<div class="col-sm-10">
				<input type="text" th:field="*{homepageHeading}" class="form-control" />
			</div>
		</div>

		<div class="form-group">
			<label for="title" class="col-sm-2 control-label">Top page heading:</label>
			<div class="col-sm-10">
				<input type="text" th:field="*{topHeading}" class="form-control" />
			</div>
		</div>

		<div class="form-group">
			<label for="footer" class="col-sm-2 control-label">Footer:</label>
			<div class="col-sm-10">
				<textarea th:field="*{footer}" rows="5" class="form-control"></textarea>
			</div>
		</div>

		<div class="form-group">
			<label for="googleAdsense" class="col-sm-2 control-label">Google Adsense:</label>
			<div class="col-sm-10">
				<textarea th:field="*{googleAdsense}" rows="5" class="form-control"></textarea>
			</div>
		</div>

		<div class="form-group">
			<label for="googleAnalytics" class="col-sm-2 control-label">Google Analytics:</label>
			<div class="col-sm-10">
				<textarea th:field="*{googleAnalytics}" rows="5" class="form-control"></textarea>
			</div>
		</div>

		<div class="form-group">
			<label for="channelTitle" class="col-sm-2 control-label">Channel Title:</label>
			<div class="col-sm-10">
				<input type="text" th:field="*{channelTitle}" class="form-control" />
			</div>
		</div>

		<div class="form-group">
			<label for="channelLink" class="col-sm-2 control-label">Channel Link (without trailing slash):</label>
			<div class="col-sm-10">
				<input type="text" th:field="*{channelLink}" class="form-control" />
			</div>
		</div>

		<div class="form-group">
			<label for="channelDescription" class="col-sm-2 control-label">Channel description:</label>
			<div class="col-sm-10">
				<textarea th:field="*{channelDescription}" rows="5" class="form-control"></textarea>
			</div>
		</div>

		<div class="form-group">
			<label for="newsSocialButtons" class="col-sm-2 control-label">News social button:</label>
			<div class="col-sm-10">
				<textarea th:field="*{newsSocialButtons}" rows="5" class="form-control"></textarea>
			</div>
		</div>

		<div class="form-group">
			<label for="disqusCode" class="col-sm-2 control-label">Disqus code:</label>
			<div class="col-sm-10">
				<textarea th:field="*{disqusCode}" rows="5" class="form-control"></textarea>
			</div>
		</div>

		<div class="form-group">
			<label for="twitterOauth" class="col-sm-2 control-label">Twitter OAuth:</label>
			<div class="col-sm-10">
				<input type="text" th:field="*{twitterOauth}" class="form-control" placeholder="format: ConsumerKey:ConsumerSecret:AccessToken:AccessTokenSecret" />
			</div>
		</div>

        <input type="submit" class="btn btn-primary" value="Save" />

</form>

<th:block th:include="layout/footer :: footer"></th:block>

</div>
</body>
</html>